﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfApplicationExperimental.DetailedControls
{
    /// <summary>
    /// Interaction logic for GenericDetailsView.xaml
    /// </summary>
    public partial class GenericDetailsView : UserControl
    {


        public System.Type typeofObject;
        List < System.Reflection.PropertyInfo> propertiesInfos;
        public GenericDetailsView()
        {
            InitializeComponent();

            propertiesInfos =  this.typeofObject.GetProperties().ToList ();

            GenerateColumnDefinitions();

            CreateRowsDefinitions();
        }

        private void CreateRowsDefinitions()
        {
            foreach (System.Reflection.PropertyInfo info in propertiesInfos)
            {
                this.maingrid.RowDefinitions.Add(new RowDefinition ());
            }

            this.maingrid.RowDefinitions.Add(new RowDefinition());


            foreach (System.Reflection.PropertyInfo info in propertiesInfos)
            {
                Label label = new Label();
              //  this.maingrid .co//label.
            }

        }

        private void GenerateColumnDefinitions()
        {
            this.maingrid.ColumnDefinitions.Add(new ColumnDefinition());
            this.maingrid.ColumnDefinitions.Add(new ColumnDefinition());

        }
    }
}
